const mongoose = require("mongoose");

const userSchema = new mongoose.Schema({
  username: {
    type: String,
    require: true
  },
  password: {
    type: String,
    require: true,
    select: false
  },
  tel: String,
  email: String,
  age: Number,
  sex: {
    type: Number,
    default: 0
  },
  icon: {
    type: String,
    default: 'https://oms-file.s3.us-west-2.amazonaws.com/news/431a04e6c9d24e5b9442f360bd85cb54.png'
  },
  brithDay: {
    type: Date,
    default: new Date()
  },
  createTime: {
    type: Date,
    default: new Date()
  },
  userID: String,
  role: {
    type: Number,
    default: 0
  },
  disable: {
    type: Boolean,
    default: false
  },

})

module.exports = mongoose.model("user", userSchema, 'user')
